<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div style="padding: 15px;" id="dom-win-ro-add">

<form class="layui-form" id="form-user-role" lay-filter="form-user-role">

<div style="overflow: auto;height:460px;">	

	
	<div style="padding-bottom:15px;">
	
	 <c:forEach items="${roleList }" var="role">
		<div class="layui-form-item" style="padding-left:20px;padding-top:5px;">
	
		    <div class="layui-input-inline" style="width: 150px;">
		      <input type="checkbox" name="m_ids" title="${role.ro_name}" value="${role.ro_id}" 
		      		lay-skin="primary" ${role.ro_check?"checked":"" } >
		    </div>
		  
		</div>
	</c:forEach> 
	</div>
	<div class="layui-form-item"   >
    
      <button class="layui-btn" id="bn-user-set-role" >提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    
  </div>

</div>
   
	
	
	
</form>

</div>

<script type="text/javascript">

$('#bn-user-set-role').click(function(){
	var mids=[];
	$('#form-user-role :checkbox:checked').each(function(){
		mids.push(this.value);
	});

	console.log(mids);

	opr.ajaxWithConfirm({
		title: "您确实添加该角色权限吗?",						
		url : 'user/role/${u_id}',//此处\${ro_id}	是el表达式，不是js代码，运行于服务器端。					
		method : 'put',	
		data:JSON.stringify(mids),
		contentType:'application/json;charset=UTF-8',
		layer:layer
	});
	
	return false;
});




</script>


